<template>
  <div class="cart">
    <nav-bar class="nav-bar">
      <div slot="mid">购物车({{ cartLength }})</div>
    </nav-bar>
    <scroll class="content">
      <cart-list :cart-list="cartList"></cart-list>
    </scroll>
    <cart-bottom-bar></cart-bottom-bar>
  </div>
</template>

<script>
import NavBar from "../../components/common/navbar/NavBar.vue";
import CartList from "./childConponents/CartList.vue";
import CartBottomBar from "./childConponents/CartBottomBar.vue";

import { mapGetters } from "vuex";
import Scroll from "../../components/common/scroll/Scroll.vue";

export default {
  name: "Cart",
  components: { NavBar, Scroll, CartList, CartBottomBar },
  computed: {
    ...mapGetters(["cartLength", "cartList"]),
  },
};
</script>

<style scoped>
.cart {
  position: relative;
  height: 100vh;
}
.nav-bar {
  background-color: var(--color-tint);
  color: #fff;
  font-weight: 700;
}

.content {
  height: calc(100% - 93px);
  overflow: hidden;
}
</style>
